package com.cpfmat.common;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Pattern;

import com.cpfmat.entity.SystemMenu;
import com.cpfmat.vo.Company;
import com.cpfmat.vo.HomeBigPicture;
import com.cpfmat.vo.Partner;
import com.cpfmat.vo.WebSite;
import com.cpfmat.vo.WorkTime;

public final class Contains {
	public static WebSite webSite;
	public static Company company;
	public static WorkTime workTime;
	public static List<HomeBigPicture> pictures;
	public static List<Partner> partners;
	public static List<SystemMenu> menuInfo;
	public static Map<String,SystemMenu> menuKeyMap;
	


	/** batch处理一次性提交记录数量 */
	public static final int BATCH_COUNTS = 50;
	
	public static final int HOME_PAGE_SIZE = 7;
	
	public static final int PAGE_SIZE = 10;
	
	public static final int RECOMMEND_PAGE_SIZE = 5;

	public static final Pattern phonePattern = Pattern.compile("^[1][34578][0-9]{9}$");
	
	public static final Pattern emailPattern = Pattern.compile("^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
	
	public static final Map<String, String> specialFieldMap = new TreeMap<String, String>(new Comparator<String>() {

		@Override
		public int compare(String o1, String o2) {
			return Integer.compare(Integer.valueOf(o1), Integer.valueOf(o2));
		}
		
	});
	
	static {
		specialFieldMap.put("1", "航空航天");
		specialFieldMap.put("2", "生物制药");
		specialFieldMap.put("3", "网络空间");
		specialFieldMap.put("4", "先进材料");
		specialFieldMap.put("5", "新型能源");
		specialFieldMap.put("6", "装备制造");
		specialFieldMap.put("99", "其他");
	}
}
